package com.qf.controller;

import com.qf.bean.Student;
import com.qf.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 2019/12/3
 * Administrator
 * sss1203
 * 面向对象面向君  不负代码不负卿
 */
@Controller
public class StudentController {

    @Autowired
    private StudentService studentService;

    @RequestMapping("/getstudents")
    public  String getstu(@RequestParam(defaultValue = "1") int pageindex, ModelMap map){
        Page<Student> studentPage = studentService.findstudents(pageindex, 3);
        map.addAttribute("stupage",studentPage);
        return "show";
    }
}
